package day015.homework.p8;

import java.util.Objects;

public class Student {
    private String stuID;
    private String name;
    private double score;

    public Student() {
    }

    public Student(String stuID, String name, double score) {
        this.stuID = stuID;
        this.name = name;
        this.score = score;
    }

    public String getStuID() {
        return stuID;
    }

    public void setStuID(String stuID) {
        this.stuID = stuID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "stuID='" + stuID + '\'' +
                ", name='" + name + '\'' +
                ", score=" + score +
                '}';
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        Student student = (Student) obj;
        return stuID.equals(student.stuID);
    }

    @Override
    public int hashCode() {
        return Objects.hash(stuID);
    }
}

